package com.hdyg.sixg.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hdyg.sixg.R;
import com.hdyg.sixg.entry.NativeGuideBean;

import java.util.List;

/**
 * @author CZB
 * @describe 菜单栏
 * @time 2019/3/20 14:22
 */
public class MenuAdapter extends BaseQuickAdapter<NativeGuideBean, BaseViewHolder> {
    public MenuAdapter(int layoutResId, @Nullable List<NativeGuideBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NativeGuideBean item) {
        if (item.isSelect()){
//            helper.setImageResource(R.id.iv_guide,item.getSelectImg());
            helper.setTextColor(R.id.tv_guide,mContext.getResources().getColor(R.color.main_color));
            helper.setBackgroundRes(R.id.ll_guide,R.color.main_color);
        }else {
//            helper.setImageResource(R.id.iv_guide,item.getUnSelectImg());
            helper.setTextColor(R.id.tv_guide,mContext.getResources().getColor(R.color.white));
            helper.setBackgroundRes(R.id.ll_guide,android.R.color.transparent);
        }
        helper.setText(R.id.tv_guide,item.getText());
    }
}
